<?php
 
 // Defines the Sighting object
// When rebuilding SilverStripe DB, this will create DB table for Sighting
 
class Sighting extends DataObject {
   
   //Define object elements
   static $db = array(
      'Date' => 'Varchar',
	  'Time' => 'Time',
	  'Wind' => 'Int',
	  'Wave_Ht' => 'Int',
	  'Depth' => 'Int',
	  'Temp' => 'Int',
	  'Visibility' => 'Int',
	  'Encounter_Length' => 'Int',
	  'Start_Long' => 'Float',
	  'Start_Lat' => 'Float',
	  'End_Long' => 'Float',
	  'End_Lat' => 'Float',
	  'Vessel_State' => 'Varchar'
   );

	// Define one to many relationship
	static $has_many = array(
		'Photos' => 'Photo'
	);

	//Define many to many relationship	
	static $many_many = array(
		'Whales' => 'Whale'
	);
	
	// Sighting is on many side of one-many relationship with vessel
	static $has_one = array(
		'MyVessel' => 'Vessel'
	);

	
}

?>